<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>智能排课系统 - 登录</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/login.css') }}">
</head>
<body>
<div class="login-container">
    <div class="card shadow-sm">
        <div class="card-header text-center bg-white border-0">
            <h4><i class="bi bi-calendar-event"></i> 智能排课系统</h4>
            <a href="#" class="settings-toggle"><i class="bi bi-gear-fill"></i></a>
        </div>
        <div class="card-body">
            <div class="banner"></div>
            <h5 class="card-title">欢迎回来</h5>
            {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
            {% for category, message in messages %}
            <div id="error-msg" class="text-danger text-center mb-3">
                {{ message }}
            </div>
            {% endfor %}
            {% endif %}
            {% endwith %}
            <p class="card-subtitle text-muted">请登录您的账户</p>
            <form method="POST">
                <div class="mb-3 input-group">
                    <span class="input-group-text"><i class="bi bi-person-fill"></i></span>
                    <input name="username" type="text" class="form-control" placeholder="用户名" required>
                </div>
                <div class="mb-3 input-group position-relative">
                    <span class="input-group-text"><i class="bi bi-lock-fill"></i></span>
                    <input id="pwd" name="password" type="password" class="form-control" placeholder="密码" required>
                    <span class="pwd-toggle" onclick="togglePwd()">
              <i id="pwd-icon" class="bi bi-eye-fill"></i>
            </span>
                </div>
                <div class="d-flex justify-content-between align-items-center mb-3">
                    <div class="form-check">
                        <input name="remember" class="form-check-input" type="checkbox" id="remember">
                        <label class="form-check-label" for="remember">记住我</label>
                    </div>
                    <a href="#" data-bs-toggle="modal" data-bs-target="#forgotModal" class="link-primary">忘记密码?</a>
                </div>
                <button type="submit" class="btn btn-primary w-100">登录 →</button>
            </form>
        </div>
        <div class="card-footer text-center">
            还没有账户?
            <a href="#" data-bs-toggle="modal" data-bs-target="#contactModal">联系管理员</a>
        </div>
    </div>
</div>
<!-- 1. 忘记密码 Modal -->
<div class="modal fade" id="forgotModal" tabindex="-1" aria-labelledby="forgotModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="forgotModalLabel">忘记密码</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="关闭"></button>
            </div>
            <div class="modal-body">
                请联系管理员获取重置密码帮助：
                <ul class="mt-2">
                    <li>姓名：张三</li>
                    <li>手机号：138-0013-8000</li>
                    <li>微信号：zhangsan_admin</li>
                </ul>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>

<!-- 2. 联系管理员 Modal -->
<div class="modal fade" id="contactModal" tabindex="-1" aria-labelledby="contactModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="contactModalLabel">管理员联系方式</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="关闭"></button>
            </div>
            <div class="modal-body">
                <p>您可以通过以下方式联系管理员：</p>
                <ul class="mt-2">
                    <li>姓名：张三</li>
                    <li>手机号：138-0013-8000</li>
                    <li>微信号：zhangsan_admin</li>
                </ul>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-bs-dismiss="modal">知道了</button>
            </div>
        </div>
    </div>
</div>

<!-- Bootstrap JS & 自定义脚本 -->
<script src="{{ url_for('static', filename='js/bootstrap.bundle.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/login.js') }}"></script>
</body>
</html>
